﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;



    
    [TestClass()]
    public class CourseTest
    {

        [TestMethod()]
        public void EnrollStudentTest()
        {
            string name = "Analysis"; 
            Course target = new Course(name); 
            Student student = new Student("Ivo Dimov", 80133); 
            target.EnrollStudent(student);
            Assert.AreEqual(target.StudentsInCourse.Count, 1);

            target.EnrollStudent(student);
            Assert.AreEqual(target.StudentsInCourse.Count, 1);

        }

        [TestMethod()]
        [ExpectedException(typeof( Exception))]
        public void TestEnrollForException()
        {
            string name = "Analysis";
            Course target = new Course(name); 

            Random r = new Random();
            for (int i = 0; i < 100; i++)
            {

                int next = r.Next(10000, 99999);

                Student s = new Student("Alabala", next);
                target.EnrollStudent(s);
            }

            //Assert.AreEqual(target.StudentsInCourse, 30);
        }

        /*
        /// <summary>
        ///A test for RemoveStudent
        ///</summary>
        [TestMethod()]
        public void RemoveStudentTest()
        {
            string name = string.Empty; // TODO: Initialize to an appropriate value
            Course target = new Course(name); // TODO: Initialize to an appropriate value
            Student stud = null; // TODO: Initialize to an appropriate value
            target.RemoveStudent(stud);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
        */
     

    }

